import { ref } from "vue";
import { http } from "../http";
import { Options } from "../interface/options.interface";

export function useOptions(resource: string | undefined) {
  const options = ref({} as Options);

  const getOptions = async () => {
    options.value = (await http.post(`/${resource}/options`))?.data;
  };
  // getOptions();
  return {
    options,
    getOptions,
  };
}
